package cn.com.egova.web.action;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

/**
 * Created by yuanchao on 2020/5/26.
 */
public class BaseAction extends ActionSupport {
    private static final long serialVersionUID = 2736308223315548464L;
    private Integer pageCode = 1;
    private Integer pageSize = 5;

    public void setPageCode(Integer pageCode) {
        if (pageCode == null) {
            pageCode = 1;
        }
        this.pageCode = pageCode;
    }

    public void setPageSize(Integer pageSize) {
        if (pageSize == null) {
            pageSize = 5;
        }
        this.pageSize = pageSize;
    }

    public Integer getPageCode() {
        return pageCode;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    /**
     * 调用值栈对象的set方法
     * @param key
     * @param obj
     */
    public void setValueStack(String key, Object obj) {
        ActionContext.getContext().getValueStack().set(key, obj);
    }

    /**
     * 调用值栈对象的push方法
     * @param obj
     */
    public void pushValueStack(Object obj) {
        ActionContext.getContext().getValueStack().push(obj);
    }
}
